package com.mybatisplus.demo.excel;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Invoice {

    //客户名称
    private String custName;

    //供应商
    private String supplier;

    //产品代码
    private String code;

    //产品名称
    private String productName;

    //规格型号
    private String specifications;

    //单位
    private String unit;

    //数量
    private double quantity;

    //实际含税单价
    private BigDecimal priceWithTax;

    //价税合计
    private BigDecimal totalMoneyWithTax;

    //单价
    private BigDecimal price;

    //总额
    private BigDecimal totalMoney;

    //合同号
    private String conNum;

//    public Invoice(Integer quantity, BigDecimal priceWithTax, BigDecimal price) {
//        this.totalMoneyWithTax = priceWithTax.multiply(new BigDecimal(quantity));
//        this.totalMoney = price.multiply(new BigDecimal(quantity));
//    }

    // = priceWithTax / 1.13
    private BigDecimal priceWithoutTax;

    //不含税成本金额
    // = priceWithoutTax * quantity
    private BigDecimal totalMoneyWithoutTax;

    //毛利润
    // = totalMoney - totalMoneyWithoutTax
    private BigDecimal grossProfit;

    //销售毛利率
    // = grossProfit / totalMoney
    private BigDecimal profit;

    //采购价格
    private BigDecimal stockIn;

}
